<!DOCTYPE html>
<html>

	<head lang="en">
		<meta charset="UTF-8">
		<title>{{ Config::get('app.title') }}--找回密码</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="format-detection" content="telephone=no">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<meta name="csrf-token" content="{{ csrf_token() }}">

		<link rel="stylesheet" href="/homes/AmazeUI-2.4.2/assets/css/amazeui.css" />
		<link href="/homes/css/dlstyle.css" rel="stylesheet" type="text/css">
		<script src="/homes/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
		<script src="/homes/AmazeUI-2.4.2/assets/js/amazeui.min.js"></script>
	</head>

	<body>

		<div class="login-boxtitle">
			<a href="home.html"><img alt="logo" src="/homes/images/logobig.jpg" /></a>
		</div>

		<div class="login-banner">
			<div class="login-main">
				<div class="login-banner-bg" style="position:relative;top:20px;left:30px;"><span></span>
					<img src="/homes/images/timg.jpg" /><br>
					<span style="font-size:20px;color:red;font-weight:bold;">衣秀 yishow </span><span style="font-size:20px;color:black;font-weight:bold;"> | 您的私人订制</span>
				</div>
				<div class="login-box">
					<h3 class="title">重设密码</h3>
					<div class="clear"></div>					
					<div class="am-tab-panel">
						<form method="post" action="/home/password/update">
							{{ csrf_field() }}
							<div class="user-phone">
								<label for="phone"><i class="am-icon-mobile-phone am-icon-md"></i></label>
								<input type="tel" name="tel" id="phone" placeholder="请输入手机号">
							</div>	
							<div class="user-email" style="height:12px;">
								<img src="" alt="" id="cunzai6">
								<span style="font-size:12px;position:relative;top:-3px;" id="six"></span>
							</div>																		
							<div class="verification">
								<label for="code"><i class="am-icon-code-fork"></i></label>
								<input type="tel" name="code" id="telcode" placeholder="请输入验证码">
								<a class="btn" href="javascript:void(0);" onClick="get_mobile_code();" id="sendMobileCode">
								<span id="dyMobileButton" style="width:100px;">获取</span></a>
							</div>
							<div class="user-email" style="height:12px;">
								<img src="" alt="" id="cunzai7">
								<span style="font-size:12px;position:relative;top:-3px;" id="qi"></span>
							</div>
							<div class="user-pass">
								<label for="password"><i class="am-icon-lock"></i></label>
								<input type="password" name="userpwd" id="telpassword" placeholder="设置密码">
							</div>	
							<div class="user-email" style="height:12px;">
								<img src="" alt="" id="cunzai8">
								<span style="font-size:12px;position:relative;top:-3px;" id="ba"></span>
							</div>									
							<div class="user-pass">
								<label for="passwordRepeat"><i class="am-icon-lock"></i></label>
								<input type="password" name="reuserpwd" id="telpasswordRepeat" placeholder="确认密码">
							</div>
							<div class="user-email" style="height:12px;">
								<img src="" alt="" id="cunzai9">
								<span style="font-size:12px;position:relative;top:-3px;" id="jiu"></span>
							</div>
							<div style="height:15px;lineheight:15px;">
								<input style="width:14px;position:relative;top:0px" type="checkbox"> <span style="position:relative;top:-17px;font-size:13px;">点击表示您同意商城《服务协议》</span>
							</div>
							<div class="user-email" style="height:12px;">
								<img src="" alt="" id="cunzai10" style="position:relative;top:15px;">
								<span style="font-size:12px;position:relative;top:11px;" id="shi"></span>
							</div>
							<div class="am-cf">
								<input type="submit" name="" value="重 新 设 置" class="am-btn am-btn-primary am-btn-sm am-fl" onclick="return fun2();">
							</div>	
						</form>
						

									<hr>
								</div>
        
		            <div class="login-links">
						<a href="http://www.yishow.com/home/login" class="zcnext am-fr am-btn-default">登录</a>
						<br />
		            </div>
				</div>
			</div>
		</div>


					<div class="footer ">
						<div class="footer-hd ">
							<p>
								<a href="# ">恒望科技</a>
								<b>|</b>
								<a href="# ">商城首页</a>
								<b>|</b>
								<a href="# ">支付宝</a>
								<b>|</b>
								<a href="# ">物流</a>
							</p>
						</div>
						<div class="footer-bd ">
							<p>
								<a href="# ">关于恒望</a>
								<a href="# ">合作伙伴</a>
								<a href="# ">联系我们</a>
								<a href="# ">网站地图</a>
								<em>© 2015-2025 Hengwang.com 版权所有</em>
							</p>
						</div>
					</div>
	</body>
	<script>
		// 手机发送验证码
var time = null;
function get_mobile_code(){
	$.ajaxSetup({
		        headers: {
		            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		        }
		});

    $.post('/home/register/phone', {mobile:$('#phone').val()}, function(msg) {
        alert(jQuery.trim(unescape(msg)));
			if($('#phone').val() == ''){
			$('#cunzai6').attr({'src':'/homes/js/images/error.png'})
			$('#six').text('手机号不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		}

		if(msg=='提交成功'){
			// RemainTime();
			var i = 60;
			
			if(time == null){
				time = setInterval(function(){	
					i--
					if(i < 1){
						$('#dyMobileButton').text('重新获取')
						// session(['phone_code' => '']);
					}else{
						$('#dyMobileButton').text(i+'秒')
					}
					// console.log(i);
					if(i < 0){
						clearInterval(time);
						time = null;
					}
					
				},1000);
			}

		}
    });

};
var iTime = 59;
var Account;


// 手机号验证
// 设置跳转标示
var v1 =false
var v2 =false
var v3 =false
var v4 =false
$('#phone').focusout(function(){
	if($('#phone').val() == ''){
		$('#cunzai6').attr({'src':'/homes/js/images/error.png'})
		$('#six').text('手机号不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
	}else{
		var ret = /^1[34578]\d{9}$/;
		if(!ret.test($('#phone').val())){
			$('#cunzai6').attr({'src':'/homes/js/images/error.png'})
			$('#six').text('手机号格式不正确').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		}else{
			// alert($('#phone').val())
			$.get('/ajax/index2','tel='+$('#phone').val(), function(a){
				// alert(a)
			if(a == 1){
					$('#cunzai6').attr({'src':'/homes/js/images/right.png'})
					v1 = true
					$('#six').text('该手机号为用户').attr({'style':'font-size:12px;position:relative;top:-3px;color:green;'})
			}else if(a == 2){
					$('#cunzai6').attr({'src':'/homes/js/images/error.png'})
					$('#six').text('该手机还没有注册').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
				}
			})
		}
	}	
}).focusin(function(){
	$('#cunzai6').attr({'src':''})
	$('#six').text('')
})

$('#telpassword').focusin(function(){
	$('#cunzai8').attr({'src':''})
	$('#ba').text('')
}).focusout(function(){
	// alert(11)
	if($('#telpassword').val() == ''){
		$('#cunzai8').attr({'src':'/homes/js/images/error.png'})
		$('#ba').text('密码不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
	}else{
		var pattern = /^[a-zA-Z]\w{7,15}$/
		// alert($('#password').val())
		var res = pattern.test($('#telpassword').val())
		// alert(res)

		if(!res){
			$('#cunzai8').attr({'src':'/homes/js/images/error.png'})
			$('#ba').text('密码请填写以字母开头的6-18位').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		}else{
			$('#cunzai8').attr({'src':'/homes/js/images/right.png'})
			$('#ba').text('密码可以用').attr({'style':'font-size:12px;position:relative;top:-3px;color:green;'})
			 v2 = 1
		}
	}
	
	
})
$('#telpasswordRepeat').focusin(function(){
	$('#cunzai9').attr({'src':''})
	$('#jiu').text('')
}).focusout(function(){
	if($('#telpasswordRepeat').val() == ''){
		$('#cunzai9').attr({'src':'/homes/js/images/error.png'})
		$('#jiu').text('确认密码不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
	}else{
		if($('#telpasswordRepeat').val() != $('#telpassword').val()){
			$('#cunzai9').attr({'src':'/homes/js/images/error.png'})
			$('#jiu').text('密码与确认密码不一致').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		}else{
			$('#cunzai9').attr({'src':'/homes/js/images/right.png'})
			$('#jiu').text('确认密码与密码一致').attr({'style':'font-size:12px;position:relative;top:-3px;color:green;'})
			 v3 =1
		}
	}
	
	
})
$('#telcode').focusout(function(){
	if($('#telcode').val() == ''){
			$('#cunzai7').attr({'src':'/homes/js/images/error.png'})
			$('#qi').text('验证码不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
	}else{
		// alert(1)
		$.get('/ajax/code2',function(b){
			if($('#telcode').val() != b){
				$('#cunzai7').attr({'src':'/homes/js/images/error.png'})
				$('#qi').text('验证码不正确').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
			}else{
				$('#cunzai7').attr({'src':'/homes/js/images/right.png'})
				$('#qi').text('验证码正确').attr({'style':'font-size:12px;position:relative;top:-3px;color:green;'})
				 v4 = 1
			}
		})

	}

}).focusin(function(){
		$('#cunzai7').attr({'src':''})
		$('#qi').text('')
	})

function fun2(){
	// alert($('input:checked').val())
	if(!v1){
		$('#cunzai6').attr({'src':'/homes/js/images/error.png'})
		$('#six').text('手机号不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		return false
	}else if(!v4){
		$('#cunzai7').attr({'src':'/homes/js/images/error.png'})
		$('#qi').text('验证码不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		return false}
	else if(!v2){
		$('#cunzai8').attr({'src':'/homes/js/images/error.png'})
		$('#ba').text('密码不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		return false
	}else if(!v3){
		$('#cunzai9').attr({'src':'/homes/js/images/error.png'})
		$('#jiu').text('确认密码不能为空').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		return false
	}else if(!$('input:checked').val()){
		$('#cunzai10').attr({'src':'/homes/js/images/error.png'})
		$('#shi').text('请点击表示您同意商城《服务协议》').attr({'style':'font-size:12px;position:relative;top:-3px;color:red;'})
		return false
	}else{
		return true;
	}

	
	
}
	</script>
</html>